import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;

class Student{
    String name;
    int age;
    public Student(String name,int age) {
        this.name= name;
        this.age = age;
    }
}

class Imp implements Comparator<Integer> {
    @Override
    public int compare(Integer o1, Integer o2) {
        return o1.compareTo(o2);
    }
}

public class Test {
    public static void main2(String[] args) {
        PriorityQueue<Student> priorityQueue = new PriorityQueue<>();
        priorityQueue.offer(new Student("zhangsan",12));
        priorityQueue.offer((new Student("lisi",21)));
     }

    public static void main3(String[] args) {
        Sort sort = new Sort();
        int[] array = {3,2,1,5,4};
        sort.shellSort(array);
        System.out.println(Arrays.toString(array));
    }

    public static void main4(String[] args) {
        Imp imp = new Imp();
        PriorityQueue<Integer> priorityQueue = new PriorityQueue<>(imp);
        priorityQueue.offer(10);
        priorityQueue.offer(120);
        priorityQueue.offer(12);
        priorityQueue.offer(11);
        priorityQueue.offer(2);
        priorityQueue.offer(343);
        priorityQueue.offer(340);

        System.out.println(priorityQueue.poll());
        System.out.println(priorityQueue.poll());
        System.out.println(priorityQueue.poll());
        System.out.println(priorityQueue.poll());
        System.out.println(priorityQueue.poll());
        System.out.println(priorityQueue.poll());
    }

    public static void main(String[] args) {
        int array[] = {2,5,1,3,4};
        Heap heap = new Heap();
        heap.initHeap(array);
        heap.createHeap();
        heap.print();
        heap.HeapSort();
    }


}


